Skip to content

Update cfg to use the attribute template #1878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 1, 2025
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • cfg.attr.duplicates

Removed rules:

  • cfg.attr.syntax-explanation --- It wasn't adding anything not said in cfg.attr.syntax.

Renamed rules:

  • cfg.attr.general is now cfg.attr.intro
  • cfg.attr.restriction is now cfg.attr.allowed-positions

ehuss added 9 commits June 27, 2025 14:41
This updates to follow the attribute template where the intro should be
first.
It should perhaps say something, but this is already covered in the
attributes chapter, and I'm not sure if anything really fits here.
I personally don't think we need to explain the grammar in English. I
understand why it could be worthwhile, but I think so many parts of the
grammar are so complex that it would be infeasible to describe it all
this way.
This moves the rule to follow the template order, rewords it a bit to
simplify, and adds an example to illustrate.

Closes rust-lang#103
This is to follow the template.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
In most of the examples for these attributes, there's no lead-in, so
let's remove the lead-in here.

Let's also say "form" rather than "thing", even though "thing" does
have a certain appeal to it.

In our rule for duplicates, let's add a forward reference to the
exception to that.

Finally, we say that the attribute applied at the crate level does not
remove the crate; later, for an example, let's clarify that it only
removes the content of the crate.

Most or all of this was preexisting to this PR.
@traviscross traviscross added this pull request to the merge queue Jul 1, 2025
Merged via the queue into rust-lang:master with commit 9015826 Jul 1, 2025
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants